package org.lqq.client;

import org.lqq.config.ServerFinderAndRegisterConfig;
import org.lqq.config.impl.DefaultServerFinderAndRegisterConfig;
import org.lqq.config.impl.FeignConfig;
import org.lqq.config.impl.RibbonLoadBalanceConfig;
import org.lqq.loadbalance.LoadBalancer;
import org.lqq.loadbalance.RibbonFactory;
import org.lqq.remoteClient.FeignFactory;
import org.lqq.remoteClient.RemoteClient;
import org.lqq.serverRegisterAndFinder.serverFinder.ServerFinder;

public abstract class CommonConfigClient extends AbstractClient{

    @Override
    protected LoadBalancer createLoadBalancer() {
        return RibbonFactory.create(new RibbonLoadBalanceConfig());
    }

    @Override
    protected RemoteClient createRemoteClient(ServerFinder serverFinder, LoadBalancer loadBalancer) {
        return FeignFactory.create(new FeignConfig(), serverFinder, loadBalancer);
    }

    @Override
    public void runAPP(String configPath) {
        super.runAPP(configPath);
    }



    @Override
    protected ServerFinderAndRegisterConfig getServerFinderAndRegisterConfig() {
        return new DefaultServerFinderAndRegisterConfig();
    }
}
